package com.acme.bankapp.domain.bank.exception;

/**
 * @author Alexander Kotov (kotov.alex.22@gmail.com)
 */
public class AccountExistsException extends BankException {

    private final int id;

    public AccountExistsException(int id) {
        this.id = id;
    }

    public AccountExistsException(String message, int id) {
        super(message);
        this.id = id;
    }

    public AccountExistsException(String message, Throwable cause, int id) {
        super(message, cause);
        this.id = id;
    }

    public AccountExistsException(Throwable cause, int id) {
        super(cause);
        this.id = id;
    }

    @Override
    public String getMessage() {
        return "Account with id = " + id + " already exists";
    }
}

